@extends('layouts.default')
@section('content')
<div id="news-content">
	<div class="news-date">
		<i class="panel-title-icon fa fa-calendar-o"></i> {{ strftime("%d %B %Y",strtotime($news->date)) }}
	</div>
	<h1>{{ $news->title }}</h1>
	<cite>Par {{ $news->user->username }}</cite>
	<div class="news-contenu">
		{{ $news->contenu }}
	</div>
</div>
<hr/>
<div id="comment-list">
	@foreach($news->comments as $comment)
		<div class="single-comment">
			<div class="comment-infos">
				<span class="comment-user">{{ $comment->user->username }}, </span>
				<span class="comment-date">{{ strftime("le %d %B %Y à %H:%M:%S",strtotime($comment->date)) }}</span>
			</div>
			<div class="comment-comment">{{ str_replace("\n","<br/>",$comment->commentaire) }}</div>
		</div>
	@endforeach
</div>
@if(Auth::check())
	<div class="comment-news">
		<div class="comment-wrapper">
			<textarea id="comment" class="input-control" placeholder="Les commentaires sont limités à 500 caractères."></textarea>
		</div>
		<br/>
		<center>
			<button data-id="{{ $news->id }}" id="news-comment" class="btn btn-default">Poster mon commentaire</button>
		</center>
	</div>
@endif
@stop